package com.luxx.util;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by luxx on 2017/11/16 0016.
 */
public class PageUtil {

    public static Map pageMap(HttpServletRequest request) {
        int page = Integer.parseInt(request.getParameter("page"));
        int pageSize = Integer.parseInt(request.getParameter("rows"));
        Map map = new HashMap();
        int no = (page - 1) * pageSize;
        int num = pageSize;
        map.put("no", no);
        map.put("num", num);
        return map;
    }
}
